import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: [
      {
        find: '@/',
        replacement: '/src/'
      }
    ],
  },
  server: {
    hmr: true,
    proxy: {
      "/api": {
        target: "http://admin.xcj.com", //测试的域名
        changeOrigin: true,
        // rewrite: (path) => path.replace(/^\/api/, ""), 
        // ws: true,
        // secure: true,
      },
      "/uploads": {
        target: "http://admin.xcj.com", //测试的域名
        changeOrigin: true,
      },
    },
  },
})
